package com.rk.section1;

public class PerformanceCalculator {

    protected Performance performance;

    protected Play play;

    public PerformanceCalculator(Performance performance, Play play) {
        this.performance = performance;
        this.play = play;
    }

    public int amountFor() {
        throw new Error("sub responsibility");
    }

    public int volumeCreditsFor() {
        return Math.max(performance.getAudience() - 30, 0);
    }

    public Play getPlay() {
        return play;
    }
}
